/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.zjdt.epserver.db.dao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 *
 * @author dusin
 */
public interface DriverDao {
    boolean doCreate(Object[] bean);
    boolean doDeleteById(int id);
    boolean doUpdateById(Object[] bean);
    boolean doUpdateStatusById(int id,int status);
    
    
    Map<String,Object> findById(int id);
    Map<String,Object> findByMobilePhone(String mibilePhone);
    List<Map<String,Object>> findAll();    
    public List<Map<String,Object>> findAll(String key);
    public List<Map<String,Object>> findAll(int status);
    public List<Map<String,Object>> findAll(String key,int status);
    List<Map<String,Object>> findAllTruck(int id);
    
    public Map<String,Object> login(String username,String password);
    public boolean doUpdatePasswordByID(int id, String password);
    public boolean doUpdatePasswordByUsername(String username, String password);
    public boolean doUpdateLicensePhotoById(int id,String license);
    
    boolean doCreateTrip(String rid,String startTime,int driverId,String plateNo,String fcode,BigDecimal longitude,BigDecimal latitude);
    boolean doDeleteTrip(String rid);
    
    public boolean doUpdateTripLocation(String rid,BigDecimal longitude,BigDecimal latitude,String time,
            String stopTime,int status);    
    
    public List<Map<String,Object>> findAllTrip(int id,String date);
    public List<Map<String,Object>> findIncomingTruck(String factoryCode,String date);
    public List<Map<String,Object>> findReachedTruck(String factoryCode,String date);//返回已到达未处理的卡车
    boolean doCreateLocation(String rid,BigDecimal longitude,BigDecimal latitude,String time,int status);

    public List<Map<String, Object>> findAllHistoryTrip(int driverId, String date);

    public boolean doUpdateLicensePhotoByUsername(String username, String dueDate, String license);
}
